<%@page import="ecom.beans.EuroConvertorBean.Currency"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<div class="currencies fl_right">
    <label class="fl_left">Monnaies : </label>
    <form name="currencies" action="Controleur" method="get">
        <input name="action" value="change_currency" type="hidden"/>
        <select name="currency" onChange="this.form.submit()" class="select fl_right">
            <%                
                List<String> currencies = (List<String>) session.getAttribute("currencies");
                Currency currentCurrency = (Currency) session.getAttribute("currentCurrency");
                Iterator<String> it = currencies.iterator();
                while (it.hasNext()) {
                    String value = it.next();
                    if (currentCurrency.equals(Currency.valueOf(value))) {
                        out.print("<option selected='selected' value='" + value + "'>" + value + "</option>");
                    } else {
                        out.print("<option value='" + value + "'>" + value + "</option>");
                    }
                }
            %>
        </select>
    </form>
</div> 